package com.culturalCenter.dataCenter.enums;

import java.util.Objects;

/**
 * @author colors
 * @date 2021/4/2 14:21
 */
public enum PlatformEnum {
    PC(0, "PC端"),
    H5(1, "H5"),
    OFFICIALACCOUNT(2, "公众号"),
    MINIAPPS(3, "小程序");

    private Integer type;
    private String platform;

    PlatformEnum(Integer type, String platform) {
        this.type = type;
        this.platform = platform;
    }

    public static String platform(Integer type) {
        PlatformEnum[] values = PlatformEnum.values();
        for (PlatformEnum value : values) {
            if (Objects.equals(value.type, type)) {
                return value.platform;
            }
        }
        return null;
    }

    public Integer getType() {
        return type;
    }

    public String getPlatform() {
        return platform;
    }
}
